extends Sprite2D
@onready var area_2d: Area2D = $Area2D

signal start_dialogue(kind : int , part : int)

var can_talk : bool = false

const dialogue_kind : int = 0
const dialogue_part : int = 0

func _on_area_2d_body_entered(body: Node2D) -> void:
	can_talk = true


func _on_area_2d_body_exited(body: Node2D) -> void:
	can_talk = false


func _physics_process(delta: float) -> void:
	if can_talk and Input.is_action_just_pressed("conect"):
		start_dialogue.emit(dialogue_kind,dialogue_part)
		area_2d.queue_free()
